package jb.astronomy.project;


import android.app.Activity;
import android.os.Bundle;
import android.webkit.WebView;
import android.widget.Toast;
import android.util.Log;

public class UpdateWebScreen extends Activity {

    public static final String URL = "";
    private static final String TAG = "Class Webscreen";

    
    
    
    
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.updatewebscreen);
       
          
        String turl = getIntent().getStringExtra(URL);
        Log.i(TAG, "Recipe url = "+turl); 
        
        
        WebView webview = new WebView(this);
        webview.setInitialScale(150);
        //webview.setInitialScale(1);
        //webview.getSettings().setDefaultZoom(ZoomDensity.FAR);
        setContentView(webview);
        
        webview.getSettings().setJavaScriptEnabled(true);    
        webview.getSettings().setSupportZoom(true);       //Zoom Control on web (You don't need this  if ROM supports Multi-Touch
                                                     
        webview.getSettings().setBuiltInZoomControls(true); //Enable Multitouch if supported by ROM 
        webview.getSettings().setBuiltInZoomControls(true);
        // Simplest usage: No exception thrown for page-load error
        
        //webview.getSettings().setLoadWithOverviewMode(true);
        //webview.getSettings().setUseWideViewPort(true);
        webview.setVerticalScrollBarEnabled(false);
        webview.setHorizontalScrollBarEnabled(false);
        //webview.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY);
        //webview.setScrollbarFadingEnabled(false);
        
             
        webview.loadUrl(turl); 
     
        
           
    }
    
    public void onReceivedError(WebView view, int errorCode, String
    		description, String failingUrl) {
    	    //do something on error
    	    //Toast.makeText(UpdateWebScreen.this,  "Press menu to read full article." , Toast.LENGTH_SHORT).show();
    		 view.loadUrl("file:///android_asset/index.htm");
    view.loadData("Your internet connection may be down? Please restart your app.", "text/html", "UTF-8");

    }
    
}